<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .bx{
            width: 800px;
            height: 1500px;
            margin: 0px auto;
            background-color: pink;
        }
    .xx{
        position: fixed;
        left: 50%;
        margin-left: 400px;
        width: 50px;
        height: 150px;
        background-color:blue;
    }
    </style>
</head>
<body>
    <div class="xx">1</div>
    <div class="bx"></div>
</body>
</html>